<template>
    <view>
		<image class="faceCheck" mode="widthFix" src="https://img.zcool.cn/community/01d32e5dd39d7fa8012053c0a9791b.gif"></image>
		<button @click="getUserProfile">授权登录</button>

	</view>
</template>

<script>
	export default {
		
		data(){
			return{
				userInfo:{}
			}
    	},

        methods:{
			getUserProfile(e){
				uni.getUserProfile({
					desc: '用于登录', 
					success: (res) => {
					const userInfo = res.userInfo;
					uni.setStorageSync('userinfo',userInfo);
					this.userInfo = res.userInfo;

					uni.setStorageSync('money',9999.99);
					
					uni.navigateBack({
						delta: 1,
					})
					}
				})
			},
		}
		
	}
</script>

<style lang="scss">
	.faceCheck{
		margin-top:30rpx;
		width: 80%;
		padding-left: 135rpx;
	}
	button{
		margin-top:30rpx;
    	width: 50%; 
		background-color: var(--themeColor);
		color: #fff;
	}
</style>